
#ifndef __LOGIC_DATA_MANAGER_H__
#define __LOGIC_DATA_MANAGER_H__

#include "ConstantFormat.h"
#include "FoodFormat.h"
#include "StageFormat.h"

class cLogicDataManager : public iConstantFormatHandler,
						  public iFoodFormatHandler,
						  public iStageFormatHandler
{
public:
	static cLogicDataManager* it();

public:
	sResult Load();

	const nConstantFormat01::sConstant* GetConstantData();
	const nFoodFormat01::sFood* GetFoodData(tUInt ID);
	const nStageFormat01::sStage* GetStageData(tUInt ID);

private:
	cLogicDataManager();
	~cLogicDataManager();

	sResult LoadConstant(const tFilename& filename);
	sResult LoadFood(const tFilename& filename);
	sResult LoadStage(const tFilename& filename);

	sResult OnReadConstantFormat(const nConstantFormat01::sConstant&);
	sResult OnReadFoodFormat(const nFoodFormat01::sFood&);
	sResult OnReadStageFormat(const nStageFormat01::sStage&);

private:
	typedef tMap<tUInt, nFoodFormat01::sFood> tFoodDataMap;
	typedef tMap<tUInt, nStageFormat01::sStage> tStageDataMap;

	nConstantFormat01::sConstant m_constantData;
	tFoodDataMap m_foodDataMap;
	tStageDataMap m_stageDataMap;
};

#endif __LOGIC_DATA_MANAGER_H__
